package com.zf.zffencheng.controller;

import com.zf.zffencheng.constant.DeviceConstant;
import com.zf.zffencheng.model.Result;
import com.zf.zffencheng.model.dto.HardwarePartnerFilter;
import com.zf.zffencheng.model.pojo.HardwarePartner;
import com.zf.zffencheng.service.HardwarePartnerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: HardwarePartnerController <br/>
 * Description:  <br/>
 * date: 2021/5/28 15:12<br/>
 *
 * @author william <br/>
 */
@Api(tags = "获取当前设备版本")
@RestController
@RequestMapping("/spi/hardware/version")
public class HardwarePartnerController {
    @Autowired
    private HardwarePartnerService hardwarePartnerService;
    @GetMapping("/paiwei")
    @ApiOperation("牌位版本")
    public Result paiwei(){
        HardwarePartnerFilter hardwarePartnerFilter = new HardwarePartnerFilter();
        //牌位
        hardwarePartnerFilter.setTypeId(DeviceConstant.PAIWEI);
        hardwarePartnerFilter.setNewVersionSort(true);
        List<HardwarePartner> hardwarePartner = hardwarePartnerService.listFilter(hardwarePartnerFilter);
        return Result.ok(hardwarePartner);
    }
}
